package cn.getech.data.development.constant;

import lombok.Getter;

/**
 * 任务类型的枚举
 *
 * @author zenith
 */
@Getter
public enum WorkFlowType {


    WORKFLOW(1, "作业流","workFlow"),
    WORKFLOW_LAY(2, "作业流依赖","workflowlay");

    int code;
    String name;
    String enName;

    WorkFlowType(int code, String message, String enName) {
        this.code = code;
        this.name = message;
        this.enName = enName;
    }

    public static WorkFlowType ObjOf(Integer code) {
        if (code == null) {
            return null;
        } else {
            for (WorkFlowType s : WorkFlowType.values()) {
                if (s.getCode() == code) {
                    return s;
                }
            }
            return null;
        }
    }
    public static Boolean ObjOf(String name) {
        if (name == null) {
            return false;
        } else {
            for (WorkFlowType s : WorkFlowType.values()) {
                if (s.getEnName().equals(name)) {
                    return true;
                }
            }
            return false;
        }
    }
}
